{
  let ary = [5, 4, 3, 2, 1];
  function insertSort(ary) {
    for (let i = 1; i < ary.length; i++) {
      for (let j = i; j > 0; j--) {
        if (ary[j] < ary[j - 1]) {
          let temp = ary[j]
          ary[j] = ary[j - 1]
          ary[j - 1] = temp
        }
      }
    }
    return ary
  }
  console.log(insertSort(ary));
}